package com.gome.oa.custom.render;

import java.awt.Component;
import java.util.Date;

import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableCellRenderer;

import com.gome.oa.util.DateUtil;

/**
*
* @author: tang li
* @date: 2016年8月20日
* @desc: 
*
*/
public class DatetimeCellRenderer extends DefaultTableCellRenderer implements
		TableCellRenderer {

	private static final long serialVersionUID = 3317014653769738202L;

	public Component getTableCellRendererComponent(JTable jtable, Object value,
			boolean isSelected, boolean hasFocus, int row, int column) {
		
		if(value == null)
			return null;
		
		JTextField text = new JTextField();
		text.setText(DateUtil.format3((Date)value));
		
		return text;
	}

}
